package com.itheima.api.collection.demo03;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo01 {

    public static void main(String[] args) {

        int[] arr = {54, 21, 65, 71, 32, 16};

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

        System.out.println("------------------------------------------");

        for(int a : arr){
            System.out.println(a);
        }

        System.out.println("------------------------------------------");

        Collection<String> col = new ArrayList<String>();

        col.add("刘德华");
        col.add("古天乐");
        col.add("张家辉");

        for(String s : col){
            System.out.println(s);
        }

        System.out.println("-------------------------------------------");

        col.forEach(s -> System.out.println(s));

    }

}
